Repository navigation
Emit the string helper on demand and pin the import surface - #33
Merged
Merged
Conversation
Targeting the Anomalous rite ABI starts with what a native object requires, because a freestanding consumer has to supply every undefined symbol deliberately. Anomalous ADR 0049 records the current cost: the compiler's "unconditional unused string helper imports strlen, calloc, and memcpy", and the fixture satisfies them with fatal trap stubs that fail the proof if reached. They were unconditional because __ny_string_concat was built into every module while its only caller looked it up on demand. The helper is now built on first use, like the runtime failure function beside it. An object for a program that concatenates nothing imports exactly the five native runtime hooks -- nyrt_abi_version, nyrt_context_begin, nyrt_context_end, nyrt_fail and nyrt_profile_site -- and no libc at all, which is the ABI Anomalous reverse-engineered rather than was given. nil.native-symbol-surface pins that boundary by reading the ELF symbol table directly, so it does not depend on binutils. It also compiles a program that does concatenate and requires the helper's dependencies to come back, because otherwise the first assertion would pass just as well if the helper had been dropped entirely. Linux: 573 registered, 0 failed, 3 environment skips. The test is ELF only and skips elsewhere; it is gated on the native backend. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targeting the Anomalous rite ABI starts with what a native object requires, because a freestanding consumer has to supply every undefined symbol deliberately. Anomalous ADR 0049 records the current cost: the compiler's "unconditional unused string helper imports strlen, calloc, and memcpy", and the fixture satisfies them with fatal trap stubs that fail the proof if reached.
They were unconditional because __ny_string_concat was built into every module while its only caller looked it up on demand. The helper is now built on first use, like the runtime failure function beside it. An object for a program that concatenates nothing imports exactly the five native runtime hooks -- nyrt_abi_version, nyrt_context_begin, nyrt_context_end, nyrt_fail and nyrt_profile_site -- and no libc at all, which is the ABI Anomalous reverse-engineered rather than was given.
nil.native-symbol-surface pins that boundary by reading the ELF symbol table directly, so it does not depend on binutils. It also compiles a program that does concatenate and requires the helper's dependencies to come back, because otherwise the first assertion would pass just as well if the helper had been dropped entirely.
Linux: 573 registered, 0 failed, 3 environment skips. The test is ELF only and skips elsewhere; it is gated on the native backend.